The present invention relates to digital microprocessors, and more particularly to emulating and debugging digital microprocessors.
As the technology for manufacturing integrated circuits advances, more and more logic functions may be included in a single integrated circuit device. Modern integrated circuit (IC) devices include large numbers of gates on a single semiconductor chip, with these gates interconnected so as to perform multiple and complex functions, such as, for example, those in a general-purpose microprocessor. The manufacture of such circuits incorporating such Very Large Scale Integration (VLSI) requires that the fabrication of the circuit be error free, as some manufacturing defects may prevent it from performing all of the functions that it is designed to perform. This requires verification of the design of the circuit and also various types of electrical testing after manufacture.
In conjunction with the stuck-fault modeling and associated test generation, other circuitry may be included in the VLSI circuit specifically designed to improving its testability. One type of test circuitry is a scan path in the logic circuit. A scan path consists of a chain of synchronously clocked master/slave latches (or registers), each of which is connected to a particular node in the logic circuit. These latches can be loaded with a serial data stream (xe2x80x9cscan inxe2x80x9d) presetting the logic circuit nodes to a predetermined state. The logic circuit then can be exercised in normal fashion, with the result of the operation (at each of the nodes having a scan latch) stored in its respective latch. By serially unloading the contents of the latches (xe2x80x9cscan outxe2x80x9d), the result of the particular test operation at the associated nodes is read out and may be analyzed for improper node operation. Repetition of this operation with a number of different data patterns effectively tests all necessary combinations of the logic circuit, but with a reduced test time and cost compared to separately testing each active component or cell and all their possible interactions. Scan paths permit circuit initialization by directly writing to the latches (or registers) and directly observing the contents of the latches (or registers). Using scan paths helps to reduce the quantity of test vectors compared to traditional xe2x80x9cfunctional modexe2x80x9d approaches. Techniques for scanning such data are discussed by E. J. McCluskey in A Survey of Design for Testability Scan Techniques, VLSI Design (Vol. 5, No. 12, pp. 38-61, December 1984).
Another solution is the test access port and boundary-scan architecture defined by the IEEE 1149.1 standard, a so-called JTAG test port. IEEE 1149.1 is primarily intended as a system test solution. The IEEE 1149.1 standard requires a minimum of four package pins to be dedicated to the test function. The IEEE 1149.1 standard requires boundary scan cells for each I/O buffer, which adds data delay to all normal operation function pins as well as silicon overhead. Although it has xe2x80x9chooksxe2x80x9d for controlling some internal testability schemes, it is not optimized for chip-level testing. IEEE 1149.1 does not explicitly support testing of internal DC parametrics.
Software breakpoints (SWBP) provide another mechanism to allow the debug of microprocessor code and to evaluate performance. A SWBP is typically accomplished through opcode replacement, provided the program resides in a writable memory module which allows the opcode at the stop point to be replaced in memory with the software breakpoint opcode. In most machines, when a SWBP opcode reaches the first execute stage of an instruction execution pipeline, it causes the pipeline to stop advancing or trap to an interrupt service routine, and set a debug status bit indicating the pipeline has stopped or trapped. In processors classified as protected pipelines, instructions fetched into the pipeline after the SWBP are not executed. Instructions that are already in the pipeline are allowed to complete. To restart execution the pipeline can be cleared and then restarted by simply refetching the opcode at the SWBP memory address after the opcode is replaced in memory with the original opcode.
Testing and debugging such a complex pipeline is difficult, even when the techniques described in the preceding paragraphs are used. Aspects of the present invention provide improved methods and apparatus for chip-level testing, as well as system-level debugging.
Particular and preferred aspects of the invention are set out in the accompanying independent and dependent claims. Combinations of features from the dependent claims may be combined with features of the independent claims as appropriate and not merely as explicitly set out in the claims. The present invention is directed to improving the performance of processors, such as for example, but not exclusively, digital signal processors.
A digital system is provided with a processor, wherein the processor is operable to execute a sequence of instructions obtained from an instruction bus connected to an instruction memory circuit. The processor has system resources including registers and at least one memory circuit. The processor has condition circuitry for storing at least one condition. There is test port circuitry for receiving test commands from a remote test host. Emulation circuitry for debug events is connected to the test port circuitry, operable to cause the processor to enter a debug suspend state in response to a debug event and to leave the debug suspend state to resume execution of the sequence of instruction in response to a command received by the test port circuitry, wherein execution of the sequence of instructions ceases while the processor is in the debug suspend state. The emulation circuitry is operable to access the system resources in response to an access command received by the test port circuitry if a first condition of the at least one condition is in a first state; however, the emulation circuitry is blocked from accessing the system resources in response to an access command received by the test port circuitry if the first condition is in a second state.
According to another aspect of the present invention, the condition circuitry comprises debug enable mask bit (DBGM) circuitry operable to store either the first state or the second state in response to an instruction executed by the processor from the sequence of instructions.
According to another aspect of the present invention, the condition circuitry comprises high priority interrupt (HPI) circuitry operable to store the second state in response to the first interrupt and further operable to store the first state at the completion of the first ISR.
According to another aspect of the present invention, the processor has debug frame counter (DFC) circuitry operable to store a debug frame number corresponding to a first debug event, wherein the test port circuitry is operable to communicate the frame count number to the external test host. There is debug frame register (DFR) circuitry, operable to store an expected frame count number in response to a command received by the test port circuitry. A first access command received by the test port circuitry is not performed if the frame count number is different from the expected frame count number.
According to another aspect of the present invention, there is memory unit cycle type (MCT) circuitry connected to the emulation circuitry operable to specify a selected access type corresponding to the first condition. The emulation circuitry is operable to access the system resources in response to an access command for the selected access type received by the test port circuitry even if the first condition of the at least one condition is in the second state.
According to another aspect of the present invention, a method is provided for operating a digital system having a processor with system resources including registers and at least one memory circuit, comprising the steps of storing at least one condition within the digital system; receiving an access command from a remote test host; accessing the system resources in response to the access command if a first condition of the at least one condition is in a first state; and blocking access to the system resources in response to the access command if the first condition is in a second state.